{% extends "base.html" %}

{% block title %}
    优就业OA-个人考勤管理
{% endblock %}

{% block content %}
    <div>
    <!--切换面板-->
        <ul class="nav nav-tabs" role="tablist">
            <li role="presentation" class="active">
                <a href="#apply" aria-controls="apply" role="tab" data-toggle="tab">考勤申请</a>
            </li>
            <li role="presentation">
                <a href="#recode" aria-controls="recode" role="tab" data-toggle="tab">考勤记录</a>
            </li>
        </ul>
        <!--内容面板-->
        <div class="tab-content container-fluid">
            <div id="apply" role="tabpanel" class="tab-pane fade in active">
                <form class="form form-horizontal" method="post">
                    <input type="hidden" value="{{ csrf_token() }}" name="csrf_token">
                    <div class="form-group">
                        <label class="control-label">请假原因</label>
                        <textarea class="form-control" name="reason"></textarea>
                    </div>
                    <div class="form-group">
                        <label class="control-label">假期类型</label>
                        <select class="form-control" name="a_type">
                            <option value="事假">事假</option>
                            <option value="婚嫁">婚嫁</option>
                            <option value="产假">产假</option>
                            <option value="病假">病假</option>
                            <option value="年假">年假</option>
                            <option value="调休">调休</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label class="control-label">请假时长</label>
                        <input class="form-control" type="text" name="date">
                    </div>
                    <div class="form-group">
                        <label class="control-label">起始时间</label>
                        <input class="form-control" type="text" name="start_time">
                    </div>
                    <div class="form-group">
                        <label class="control-label">截至时间</label>
                        <input class="form-control" type="text" name="end_time">
                    </div>
                    <div class="form-group">
                        <input class="btn btn-primary pull-right" type="submit" value="发起申请">
                    </div>

                </form>
            </div>
            <div id="recode" role="tabpanel" class="tab-pane fade">
                <table class="table">
                    <thead>
                        <tr>
                            <th>假条编号</th>
                            <th>假条状态</th>
                            <th>请假类型</th>
                            <th>请假原因</th>
                            <th>起始时间</th>
                            <th>结束时间</th>
                            <th>审核人</th>
                        </tr>
                    </thead>
                    <tbody>
                        {% for a in attendance_list %}
                        <tr>
                            <td>{{ a.id }}</td>
                            <td>{{ a.a_status }}</td>
                            <td>{{ a.a_type }}</td>
                            <td>{{ a.reason }}</td>
                            <td>{{ a.start_time }}</td>
                            <td>{{ a.end_time }}</td>
                            <td>
                                {% if a.examine %}
                                    {{ a.examine }}
                                {% else %}
                                    {{ a.a_status }}
                                {% endif %}
                            </td>

                        </tr>
                        {% endfor %}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
{% endblock %}